package com.nineyang.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * ClassName:MyException
 * Description:
 * author: jiuyang
 * DateTime: 2025/2/26 下午3:17
 */
@ControllerAdvice
public class MyException {

    @ExceptionHandler(value = IllegalArgumentException.class)
    @ResponseBody
    public String exception(IllegalArgumentException e) {
        return "全局错误信息返回" + e.getMessage();
    }

}
